<%@page contentType="text/html" %>
<%@page pageEncoding="UTF-8" %>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk" %>


<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Goodwill - Общая информация по товарным группам</title>
    <link rel="stylesheet" href="resources/css/main.css"/>
    <link rel="stylesheet" href="resources/css/stylesheet.css"/>
    <link rel="stylesheet" type="text/css" href="resources/css/jquery.countdown.css">
    <script type="text/javascript">
        function reloadPage() {
            window.location.reload();
        }
    </script>
</head>
<body>
<f:view>
    <h:form>
        <h:panelGroup layout="block" styleClass="" id="dvOrderHeader">
            <h:panelGrid columns="2" cellpadding="0" cellspacing="0" columnClasses="cgray,cwhite">
                <h:outputText value="Дата начала" styleClass="b"/>
                <h:outputText value="#{GoodTypeAbsenceReportBean.beginDate}"/>
                <h:outputText value="Дата окончания" styleClass="b"/>
                <h:outputText value="#{GoodTypeAbsenceReportBean.endDate}"/>
            </h:panelGrid>
        </h:panelGroup>
        <rich:dataTable id="goodTypeAbsenceReportTable"
                        rows="#{GoodTypeAbsenceReportBean.rowsCount}"
                        value="#{GoodTypeAbsenceReportBean.goodTypes}"
                        var="goodType"
                        rendered="true"
                        rowKeyVar="row"
                        styleClass="full">
            <rich:column>
                <f:facet name="header">
                    <h:outputText value="Категория товара"/>
                </f:facet>
                <h:outputText value="#{goodType.name}"/>
            </rich:column>
            <rich:column>
                <f:facet name="header">
                    <h:outputText value="Нехватка товара"/>
                </f:facet>
                <h:outputText value="#{goodType.absence}"/>
            </rich:column>
            <rich:column>
                <f:facet name="header">
                    <h:outputText value="Стоимость непроданного товара"/>
                </f:facet>
                <h:outputText value="#{goodType.absenceCostAsString}"/>
            </rich:column>
            <f:facet name="footer">
                <rich:columnGroup>
                    <rich:column/>
                    <rich:column/>
                    <rich:column>
                        <h:outputText value="Итого: #{GoodTypeAbsenceReportBean.totalAbsenceCost}"/>
                    </rich:column>
                </rich:columnGroup>
            </f:facet>
        </rich:dataTable>
    </h:form>
</f:view>
</body>
</html>
